/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package contact;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author Heri Setiyawan
 */
public class koneksis {
    public Statement st;
    public Connection conn;
    public ResultSet rs;
    String db,drivernya,user,paswd;
    
    public void makeKoneksi(){
        user = "root";
        paswd = "@pwd12345@";
        db = "contact";
        drivernya = "com.mysql.jdbc.Driver";
        try{
            Class.forName(drivernya);
            conn = DriverManager.getConnection("jdbc:mysql://localhost/"+db,user,paswd);
            st = conn.createStatement();
            System.out.print("connection success");
        }catch(Exception q){
            System.out.print("conection lost \n"+q);
        }
    }
}
